import { defineStore } from 'pinia'

interface State {
    allPointsData: any,
    allPointsMsgCount: number,
    peopleDate: any,
    peopleMsgCount: number,
    pointData: any,
    pointMsgCount: number,
    removePeopleData: any,
    removePeopleMsgCount: number
}

export const useWsdataStore = defineStore("wsdata", {
    // state: 返回对象的函数
    state: (): State => ({
        allPointsData: {},
        allPointsMsgCount: 0,
        peopleDate: {},
        peopleMsgCount: 0,
        pointData: {},
        pointMsgCount: 0,
        removePeopleData: {},
        removePeopleMsgCount: 0

    }),
    getters: {},
    actions: {
        setAllPointsData(data: any) {
            this.allPointsData = data
        },
        addAllPointsMsgCount() {
            this.allPointsMsgCount++
        },
        setPeopleDate(data: any) {
            this.peopleDate = data
        },
        addPeopleMsgCount() {
            this.peopleMsgCount++
        },
        setPointData(data: any) {
            this.pointData = data
        },
        addPointMsgCount() {
            this.pointMsgCount++
        },
        setRemovePeopleData(data: any) {
            this.removePeopleData = data
        },
        addRemovePeopleMsgCount() {
            this.removePeopleMsgCount++
        },

    },
});